object FunDetails01 {
  def main(args: Array[String]): Unit = {
    val pig1 = new Pig
    val pig2 = toPig(19, pig1)
    println(pig2.name)
    //true
    println(pig1.hashCode() == pig2.hashCode)
  }

  def toPig(n: Int, pig: Pig): Pig = {
    if (n >= 18) {
      pig.name = "大胖猪"
    }
    return pig
  }
}

class Pig {
  var name = "小胖猪"
}

